package com.zzyl.job;

import com.zzyl.mapper.DeviceDataMapper;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class DeviceDataClearJob {

    /**
     * 定时清理 清理一月前大量的设备的数据信息  就只保留一个月的数据信息
     */
    @Autowired
    private DeviceDataMapper deviceDataMapper;
    @Scheduled(cron = "0 0 1 * * ?")
    public void clearDeviceDataJob(){
        log.info("设备上报数据，定时清理数据...");
        deviceDataMapper.clearDeviceDataJob() ;
        log.info("设备上报数据，定时清理数据结束...");
    }
}
